package com.model.speelveld;

import java.util.Observable;
import android.os.CountDownTimer;

public class WaveTime extends Observable {
	
	private CountDownTimer timer;
	private long timeMs =3500;
	
	public WaveTime(long timeMs)
	{
		this.timeMs = timeMs;
		timer =  new CountDownTimer(5000, 1000) {

		     @Override
			public void onTick(long millisUntilFinished) {
		         //mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
		     }

		     @Override
			public void onFinish() {
		         setChanged();
		         notifyObservers();
		     }
		  }.start();

		//timer.schedule(new Mtimer(), this.timeMs);
	}
	
	public long getTimeMs()
	{
		return timeMs;
	}
	
	public void setTimeMs(long timeMs)
	{
		this.timeMs = timeMs;
		 new CountDownTimer(timeMs, 1000) {

		     @Override
			public void onTick(long millisUntilFinished) {
		         //mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
		     }

		     @Override
			public void onFinish() {
		         setChanged();
		         notifyObservers();
		     }
		  }.start();
	}
	
		

}
